package demo05.SimpleFactory;

import java.util.ArrayList;

/**
 * 披萨  抽象实体类
 * */
public  abstract class Pizza {
	String name;
	String  dough; //面团
	String  sauce;//酱
	ArrayList<String> toppings = new ArrayList<String>();//配料
	
	public String getName() {
		return name;
	}
	//制作方法
	public void prepare() {
		System.out.println("准备 " + name);
	}

	public void bake() {
		System.out.println("烘烤 " + name);
	}

	public void cut() {
		System.out.println("切割 " + name);
	}

	public void box() {
		System.out.println("装盒 " + name);
	}
	@Override
	public String toString() {
		StringBuffer display = new StringBuffer();
		display.append("---- " + name + " ----\n");
		display.append(dough + "\n");
		display.append(sauce + "\n");
		for (String topping : toppings) {
			display.append(topping + "\n");
		}
		return display.toString();
	}
	
}
